feat: update CLI to migrate guest authors #3664
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closed in favor of #3724
All Submissions:
Changes proposed in this Pull Request:
This PR changes the logic of the guest author migration script.
Basically, the script was checking if a guest user already existed as a regular WP user based on the user_login. I'm changing that to check for the user_nicename.
In a regular situation, the nicename will usually be the same thing as the login, but there are cases where they can be different. One of them is when you migrated users from another system and treated these fields in a different way in the database.
CAP uses the
$user->user_nicename
to create and match the author term, and that's why this is the field we should look at.How to test the changes in this Pull Request:
Other information: